package com.springboot.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.springboot.pojo.User;

@Mapper
public interface UserMapper {

	@Select("SELECT * FROM  tb_user WHERE id =#{id} ")
	User findById(@Param("id")Long id);
	
	@Select("SELECT * FROM  tb_user WHERE user_name =#{name} ")
	User findByName(@Param("name")String name);
	
	@Insert("INSERT INTO TB_USER VALUES(#{user.userName},#{user.password}) ")
	int insert(@Param("user")User user);
}
